from google.appengine.ext import db

class Profile(db.Model):
    user = db.UserProperty(required=True,auto_current_user=True)
    datejoined = db.DateProperty(auto_now_add=True)
    nickname = db.StringProperty()
    privacy = db.StringProperty()
    abuseflags = db.IntegerProperty()

class Movie(db.Model):
    profile = db.ReferenceProperty(Profile, collection_name='movies')
    name = db.StringProperty()
    rating = db.IntegerProperty()
    average = db.RatingProperty()
    votes = db.IntegerProperty()
    abuseflags = db.IntegerProperty()

class Rating(db.Model):
    profile = db.ReferenceProperty(Profile, collection_name='ratings')
    movie = db.ReferenceProperty(Movie)
    rating = db.RatingProperty()

class MustSee(db.Model):
    profile = db.ReferenceProperty(Profile, collection_name='mustsees')
    movie = db.ReferenceProperty(Movie)
